/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.webbapps.cormac_susilo.core;

import edu.webbapps.cormac_susilo.wrappers.FrameWrapper;
import edu.webbapps.cormac_susilo.wrappers.RunWrapper;
import edu.webbapps.cormac_susilo.wrappers.UserWrapper;
import java.io.InputStream;
import java.io.Serializable;
import java.util.List;
import java.util.NoSuchElementException;
import javax.persistence.RollbackException;

/**
 * There is no javadoc for this interface, but the methods are pretty 
 * much self explanatory. There are some details in the Registry classes.
 * 
 * @author tor
 */
public interface IUserModel extends Serializable {
    
    public final String DEFAULT_RUNNAME = "Unnamed";

    UserWrapper createUser(String username, String password, String avatar, String givenname, String familyname, String email) throws RollbackException;
    
    UserWrapper uploadFile(long user_id, InputStream in, String trackname) throws NoSuchElementException, RollbackException;
    
    boolean deleteRun(long run_id) throws NoSuchElementException, RollbackException;

    boolean deleteUser(long user_id) throws NoSuchElementException, RollbackException;

    List<FrameWrapper> getFrames(long run_id) throws NoSuchElementException;

    RunWrapper getRun(long run_id) throws NoSuchElementException;

    List<RunWrapper> getRuns(long user_id) throws NoSuchElementException;

    List<RunWrapper> getRuns(long user_id, String trackname) throws NoSuchElementException;

    List<String> getTracks(long user_id) throws NoSuchElementException;

    UserWrapper getUser(String username) throws NoSuchElementException;
    
    UserWrapper getUser(long user_id) throws NoSuchElementException;

    List<UserWrapper> getUsers();

    RunWrapper renameRun(long run_id, String new_trackname) throws NoSuchElementException, RollbackException;

    List<RunWrapper> renameRuns(long user_id, String trackname, String new_trackname) throws NoSuchElementException, RollbackException;

    UserWrapper updateUser(long user_id, String username, String password, String avatar, String Givenname, String Familyname, String email) throws NoSuchElementException, RollbackException;
}
